package practice.w912;

import java.util.Arrays;
import java.util.List;

public class ArrayToList {
    public static void main(String[] args) {
        String[] arr = {"hello","world","java"};
        System.out.println(Arrays.toString(arr));
        List<String> list = Arrays.asList(arr);
        System.out.println("list:"+list);
        arr[1] = "six";
        System.out.println("array:"+ Arrays.toString(arr));
        System.out.println("list:"+list);
        list.set(2,"seven");
        System.out.println("array:"+ Arrays.toString(arr));
        System.out.println("list:"+list);


//        String[] arr = {"hello","world","java"};
//        System.out.println(Arrays.toString(arr));
//        List<String> list = Arrays.asList(arr);
//        System.out.println("list:"+list);
//        arr[1] = "six";
//        System.out.println("array:"+ Arrays.toString(arr));
//        System.out.println("list:"+list);
//        list.set(2,"seven");
//        System.out.println("array:"+ Arrays.toString(arr));
//        System.out.println("list:"+list);


    }
}
